$(document).ready(function(){

	/**
	 * Adds the blue ribbons on top of the protected contents.
	 */
	$('.myows.ribbon').each(
		function() {
			$this = $(this);
			var shortdesc = $this.attr('shortdesc');
			var longdesc = $this.attr('longdesc');
			var classes = $this.attr('class');

			if (typeof shortdesc != 'undefined'){
				if (typeof longdesc == 'undefined'){
					
					$this.addClass('wrapped').wrap('<div class="'+classes+' wrapper"></div>').after('<p><span>'+shortdesc+'</span></p>');
					$this.next().show();
					
				} else {
					
					$this.addClass('wrapped').wrap('<div class="'+classes+' wrapper"></div>').after('<p><span>'+shortdesc+' <cite>'+longdesc+'</cite></span></p>');
					$this.hover(
						function(){ $(this).next().show('fast'); },
						function(){ $(this).next().hide('fast'); }
					);
					
				}

			}
		}
	);

});